home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 3: CDPD 3
/
Almathera Ten on Ten - Disc 3: CDPD3.iso
/
ab20
/
ab20_archive
/
datacomm
/
vltjr-5.045.lzh
/
rexx
/
MarginBell.vlt
< prev
next >
Wrap
Text File
|
1991-01-03
|
1KB
|
53 lines
/** MarginBell.vlt
*
* Example program to intercept keystrokes.
* This one implements a margin bell at 72 colums
*
**/
margincol = 72
/*
* Open a port
*/
mp = openport(MARGIN_BELL)
/*
* Tell VLT to send us stuff
*/
"wedge keystrokes MARGIN_BELL"
/*
* Loop until quitflag is 1, waiting for packets
*/
do forever
if quitflag = 1 then leave
t = waitpkt(MARGIN_BELL)
/*
* We got a number of packets. Loop over all of them.
*/
do ff = 1
p = getpkt(MARGIN_BELL)
if c2d(p) = 0 then leave ff
line = getarg(p)
t = reply(p, 1)
/*
* Got something. Find out what...
*/
parse var line command code qual iaddr char .
/*
* If we got an "esc", quit.
*/
if char = '1B'x then do
quitflag = 1
"$1: BEEP; delay .7; BEEP; delay .7; BEEP"
end
/*
* Else check the current cursor x position. Send VLT a BEEP command if it
* is at the margin column.
*/
else do
"extract x"
if VLT.x = margincol then "BEEP"
end
end
end